Skip to content

Conversation

EspenAlbert
Copy link
Collaborator

Description

Adds provider_meta schema

Link to any related issue(s): CLOUDP-340210

See related full implementation here: #3618

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR. A migration guide must be created or updated if the new feature will go in a major version.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR. A migration guide must be created or updated.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contributing guides
  • I have checked that this change does not generate any credentials and that they are NOT accidentally logged anywhere.
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code
  • If changes include deprecations or removals I have added appropriate changelog entries.
  • If changes include removal or addition of 3rd party GitHub actions, I updated our internal document. Reach out to the APIx Integration slack channel to get access to the internal document.

Further comments

@EspenAlbert EspenAlbert marked this pull request as ready for review August 27, 2025 09:29
@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 09:29
@EspenAlbert EspenAlbert requested a review from a team as a code owner August 27, 2025 09:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds provider metadata schema configuration to support module tracking and user agent customization in the MongoDB Atlas Terraform provider. The changes enable the provider to collect optional metadata about modules using it and allow for custom user agent headers.

  • Adds provider meta schema definitions for both SDK v2 and Framework providers
  • Defines constants for module name, version, and user agent metadata fields
  • Implements MetaSchema method for the Framework provider

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/provider/provider_sdk2.go Adds ProviderMetaSchema configuration with optional fields for module tracking and user agent
internal/provider/provider.go Defines metadata constants and implements MetaSchema method for Framework provider

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Attributes: map[string]metaschema.Attribute{
ProviderMetaModuleName: metaschema.StringAttribute{
Description: ProviderMetaModuleNameDesc,
Optional: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we want to have this required if provider_meta is used? similar for version

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so.
Not guaranteed the provider_meta will always be used inside modules in the future

@EspenAlbert EspenAlbert merged commit 76ef72a into master Sep 5, 2025
42 checks passed
@EspenAlbert EspenAlbert deleted the CLOUDP-340210_provider_meta_modules_schema_only branch September 5, 2025 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants